﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using CRMBiz.DataImportHandler;
using CRMBiz;
using CRMWeb.Utilities.Context;

namespace CRMWeb.WebServices.DataImport
{
    /// <summary>
    /// Summary description for GetDataFromMaxFinance
    /// </summary>
    public class GetDataFromMaxFinance : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            string operatorname = string.Empty;
            try
            {
                string insertstr = (context.Request["InsertString"]);
                operatorname = CMSContext.CurrentUser.MemberName;
                if (GetDataFromMaxFinanceHandler.checkApplicationExist(insertstr, operatorname))
                    context.Response.Write("CRM_Success");
                else
                    context.Response.Write("CRM_INSERT_ERROR");
            }
            catch (Exception ex)
            {
                ErrorHandler.saveErrorLog(ex, operatorname);
                context.Response.Write("CRM_REQUEST_ERROR");
            }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}